/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fl.location.core;

import fl.location.ui.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

/**
 * @author Zeor
 */
public class MobileLocation extends MIDlet {

    MainMenu menu;
    Map map;
    CoreLoop core;
    
    //Displays
    public static final int MAIN_MENU = 0;
    public static final int SETTINGS = 1;
    public static final int MAP = 2;

    public MobileLocation() {
    }

    public void startApp() {
        menu = new MainMenu(this);
        map = new Map(this);
        core = new CoreLoop();
        Display display = Display.getDisplay(this);
//        menu.start();
        display.setCurrent(core);
        this.setFrame(MAIN_MENU);
        new Thread(core).start();
    }
    
 
    public void setFrame(int frame) {
        switch (frame) {
            case MAIN_MENU:
                core.setFrame(menu);
                break;
            case SETTINGS:
                core.setFrame(menu);
                break;
            case MAP:
                core.setFrame(map);
                break;
        }
 
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}
